﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace MCMLXVII.Tools.OrganizationChart
{
    public partial class ucEncabezado : UserControl
    {
        public event EventHandler ReloadRequested;
        public event EventHandler ExitRequested;
        
        private bool _EditInGrid = false;

        public bool EditInGrid
        { 
            get {return _EditInGrid;}
        }

        public ucEncabezado()
        {
            InitializeComponent();
            btnEditMode.Text = Properties.Resources.HidePropertyGrid;
        }

        private void btnReload_Click(object sender, EventArgs e)
        {
            if (!(ReloadRequested == null))
            {
                ReloadRequested.Invoke(this, null);
            }
        }

        private void btnEditMode_Click(object sender, EventArgs e)
        {
            if (_EditInGrid)
            {
                btnEditMode.Text = Properties.Resources.HidePropertyGrid;
                _EditInGrid = false;
            }
            else
            {
                btnEditMode.Text = Properties.Resources.ShowPropertyGrid;
                _EditInGrid = true;   
            }
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            if (!(ExitRequested == null))
            {
                ExitRequested.Invoke(this, null);
            }
        }

        private void ucEncabezado_Load(object sender, EventArgs e)
        {

        }


    }
}
